home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PROGRAMR
/
CENVIW2.ZIP
/
DOSTIME.CMM
< prev
next >
Wrap
Text File
|
1993-07-02
|
1KB
|
35 lines
/***********************************************************************
*** DosTime - CEnvi example program for showing the Dos system time ***
***********************************************************************/
#include "WinUtil.lib"
// give minimum screen size because time takes up little room
ScreenSize(12,1);
// force screen to show, just so we can then resize and move it
putchar(' ');
// move this small window to the very bottom-right corner of the screen
WinBox = GetWindowRect(ScreenHandle());
WinWidth = WinBox.right - WinBox.left + 1;
WinHeight = WinBox.bottom - WinBox.top + 1;
TotalWidth = GetSystemMetrics(SM_CXSCREEN);
TotalHeight = GetSystemMetrics(SM_CYSCREEN);
MoveWindow(ScreenHandle(), // handle for our text window
TotalWidth - (WinWidth * 8 / 12), // against right edge of screen so only numbers show
TotalHeight - WinHeight, // against bottom of screen
WinWidth,WinHeight, // keep width and height the same
True); // redraw
// print the time once per second and hang out here until a key is pressed
while( !kbhit() ) {
reg.ah = 0x2C
interrupt(0x21,reg)
printf("\r%2d:%02d:%02d",reg.ch,reg.cl,reg.dh)
Suspend(1000);
}